#include "sym_detect_widget.h"
#include "ui_sym_detect_widget.h"

sym_detect_widget::sym_detect_widget(sym_detect_plugin *p, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::sym_detect_widget)
{
    ui->setupUi(this);

    plugin = p;

	/// Signal & slot
	// detection
	plugin->connect(ui->numFeaturePoints, SIGNAL(valueChanged(int)), SLOT(setNumFeaturePoints(int)));
	plugin->connect(ui->numBasePoints, SIGNAL(valueChanged(int)), SLOT(setNumBasePoints(int)));
	plugin->connect(ui->pairing_thr, SIGNAL(valueChanged(double)), SLOT(setPairingThreshold(double)));
	plugin->connect(ui->distinctiveRatio, SIGNAL(valueChanged(double)), SLOT(setDistinctiveRatio(double)));

	plugin->connect(ui->reflectionButton, SIGNAL(clicked()), SLOT(detectReflection()));

	// visual options
	plugin->connect(ui->showPoints, SIGNAL(stateChanged(int)), SLOT(showPoints(int)));
	plugin->connect(ui->showSignatures, SIGNAL(stateChanged(int)), SLOT(showSignatures(int)));
	plugin->connect(ui->showPrunedSignatures, SIGNAL(stateChanged(int)), SLOT(showPrunedSignatures(int)));

	plugin->connect(ui->normalizeButton, SIGNAL(clicked()), SLOT(normalizeMesh()));

	plugin->connect(ui->testButton, SIGNAL(clicked()), SLOT(test()));
	plugin->connect(ui->debugButton, SIGNAL(clicked()), SLOT(debug()));
}


sym_detect_widget::~sym_detect_widget()
{
    delete ui;
}


int sym_detect_widget::numFeaturePoints()
{
	return ui->numFeaturePoints->value();
}

int sym_detect_widget::numBasePoints()
{
	return ui->numBasePoints->value();
}

double sym_detect_widget::pairingThreshold()
{
	return ui->pairing_thr->value();
}

double sym_detect_widget::distinctiveRatio()
{
	return ui->distinctiveRatio->value();
}
